package ui.faces
{
	import events.GestureEvent;
	
	import global.Managers;
	
	import ui.components.Button;
	
	public class IdleFace extends AbstractFace
	{
		private var _btnCreateBill				: Button;
		
		public function IdleFace()
		{
			super();
		}
		override protected function createBG():void {
			super.createBG();
			_bg.addChild(Managers.resourceManager.getBitmap("faces/idleBG.jpg"));
		}
		override protected function createView():void {
			super.createView();
			
			_btnCreateBill = new Button(0, _languageManager.getLanguageText("create_bill"), 150, 40, "", function(event:GestureEvent):void {
				Managers.billManager.createBill();
			});
			_btnCreateBill.x = 850;
			_btnCreateBill.y = 720;
			addChild(_btnCreateBill);
			_btnCreateBill.addListener(this);
		}
		
		/**
		 *
		 * 切换语言 
		 * @param toLanguage 切换到的语言
		 * 
		 */
		override public function switchLanguage(toLanguage:int):void
		{
			super.switchLanguage(toLanguage);
			
			if(toLanguage == _currentLanguage) return;
			_currentLanguage = toLanguage;
			
			_btnCreateBill.text = _languageManager.getLanguageText("create_bill");
		}
		override public function reset():void {
			super.reset();
			Managers.panelManager.closeAll();
		}
	}
}